import React, { useReducer } from 'react'

import { reducer, initialState } from './reducer'

export default function App() {
  const [state, dispatch] = useReducer(reducer, initialState)
  console.log('state', state)
  return (
    <div>
      <h1>App</h1>
      <button
        onClick={() =>
          dispatch({ type: 'increment', payload: { a: 1 }, aa: 3 })
        }
      >
        +
      </button>
      {state.count}
      <button
        onClick={() => dispatch({ type: 'decrement', payload: { b: 1 } })}
      >
        -
      </button>
    </div>
  )
}
